package pers.xds.wtuapp.web.security.common;

import com.fasterxml.jackson.annotation.JsonInclude;

/**
 * @author DeSen Xu
 * @date 2022-12-31 21:32
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AuthSuccessResponse {

    /**
     * jwt
     */
    public String token;

    public int userId;

    public String email;

    public String nickname;

    public String wtuId;

    public String name;

    public String className;

    public int roles;

    public String academy;

    public String signature;

    public AuthSuccessResponse(UserLoginPrincipal userLoginPrincipal, String token, int roles) {
        this.userId = userLoginPrincipal.getUid();
        this.token = token;
        this.email = userLoginPrincipal.getEmail();
        this.nickname = userLoginPrincipal.getNickname();
        this.wtuId = userLoginPrincipal.getWtuId();
        this.name = userLoginPrincipal.getName();
        this.className = userLoginPrincipal.getClassName();
        this.academy = userLoginPrincipal.getAcademy();
        this.roles = roles;
        this.signature = userLoginPrincipal.getSignature();
    }


}
